#pragma once

#include <unordered_map>
#include "../share/user_define.h"
#include "../../3rd/libjson/json.h"

/*
"id": 8,
"skill1": 3500,
"skill2": 3500,
"skill3": 13500,
"skill4": 27000
*/

struct UpgradeSkillConsume
{
	uint32_t mId;
	uint32_t mSkill1;
	uint32_t mSkill2;
	uint32_t mSkill3;
	uint32_t mSkill4;

	UpgradeSkillConsume()
	{
		Clear();
	}

	void Clear(void)
	{
		mId = 0;
	}
};

class UpgradeSkillConsumeCacheData
{
public:

	static void CreateInstance(void);
	static UpgradeSkillConsumeCacheData* GetInstance(void);

	~UpgradeSkillConsumeCacheData(void);

public:

	bool Initialization(void);

	bool Reload(void);

	UpgradeSkillConsume* GetData(uint32_t id);

	bool GetDataJsonString(uint32_t id, Json::Value& _jm);

	uint32_t GetDataCount(void);

private:
	UpgradeSkillConsumeCacheData(void);

	void Clear(void);

	void AddData(uint32_t id, Json::Value& jm);


private:

	static UpgradeSkillConsumeCacheData* mInstance;

	std::unordered_map<uint32_t, UpgradeSkillConsume*> m_mapCacheData;
	uint32_t m_maxCount;

};